﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Animation;
using System.Windows.Shapes;
using GameEngine.Clients.Silverlight.View;
using GameEngine.Model.Data;
using GameEngine.View.Components;

namespace MySettlers.Screens
{
    public partial class GameEditorMenu : UserControl, IMenuView<string>
    {
        public event OnButtonClickHandler<string> OnExternalActionButtonClick;
        public const string BACKBUTTON = "BACKBUTTON";
        public const string NEWLEVELBUTTON = "NEWLEVELBUTTON";
        public const string EDITLEVELBUTTON = "EDITLEVELBUTTON";
        public const string NEWTHINGTYPEBUTTON = "NEWTHINGTYPEBUTTON";
        public const string EDITTHINGTYPEBUTTON = "EDITTHINGTYPEBUTTON";
        public const string NEWVIEWBUTTON = "NEWVIEWBUTTON";
        public const string EDITVIEWBUTTON = "EDITVIEWTYPEBUTTON";
        public const string NEWRESOURCEBUTTON = "NEWRESOURCEBUTTON";
        public const string EDITRESOURCEBUTTON = "EDITRESOURCETYPEBUTTON";

        public GameEditorMenu(IGameVO<int> vo)
        {
            InitializeComponent();
            //TODO encher combobx PlayButton.Tag = PLAYBUTTON;

            BackButton.Tag = BACKBUTTON;

            NewLevelButton.Tag = NEWLEVELBUTTON;
            EditLevelButton.Tag = EDITLEVELBUTTON;

            NewThingTypeButton.Tag = NEWTHINGTYPEBUTTON;
            EditThingTypeButton.Tag = EDITTHINGTYPEBUTTON;

            NewViewButton.Tag = NEWVIEWBUTTON;
            //EditViewButton.Tag = EDITVIEWTYPEBUTTON;

            NewResourceButton.Tag = NEWRESOURCEBUTTON;
            //EditResourceButton.Tag = EDITRESOURCETYPEBUTTON;
        }

        private void Button_Click(object sender, RoutedEventArgs e)
        {
            Button b = (Button)sender;
            OnExternalActionButtonClick(b.Tag as string);
        }
    }
}
